<!---
to do list
Permissions
--->

<cfparam name="Student_ID" type="integer" default="0" />
<cfparam name="returnView" type="string" default="followUpRequests" />
<cfparam name="passback" type="string" default="" />

<cfscript>
	studentGateway = new assets.calgrants.com.gateway.StudentGateway();
	student = studentGateway.get(Student_ID = Student_ID);
</cfscript>
	
<cfif IsNumeric(student.getStudent_ID())>
	
	<cfscript>
		base = new assets.calgrants.com.Base();
		passbackQueryString = base.passbackToQueryString(passback);
		evaluationGateway = new assets.calgrants.com.gateway.EvaluationGateway();
		qEvaluation = evaluationGateway.query(Student_ID = student.getStudent_ID());
		evaluation = evaluationGateway.get(Evaluation_ID = qEvaluation.Evaluation_ID);
	</cfscript>
	
	<script type="text/javascript" language="javascript">
	<!--
		<cfoutput>
			var studentID = #student.getStudent_ID()#;
		</cfoutput>
		
		toggleFollowUpOther = function() {
			if ($("#followUpOther").is(":checked")) {
				$("#followUpOtherContainer").show();
			} else {
				$("#followUpOtherContainer").hide();
				$("#Follow_Up_Other").val("");
			}
		};	

		var validate = function() {
			var errors = "";
			var valid = true;
			/*if (organizationDropdown.value() == 0) {
				if (roleDropdown.value() == "Regional Admin") {
					if (regionDropdown.value() == 0) {
						valid = false;
						errors += "Region is required for Regional Admin\n";
					}
				} else if (roleDropdown.value() == "Super User") {
					regionDropdown.value(0);
				} else {
					valid = false;
					errors += "Data inconsistency error in user.  Please report this error to Cash for College.\n";	
				}
			} else {
				if (roleDropdown.value() == "Organizer" || roleDropdown.value() == "Site Contact") {
					regionDropdown.value(0);
				} else {
					valid = false;
					errors += "Data inconsistency error in user.  Please report this error to Cash for College.\n";
				}
			}*/
			if (!valid) {
				alert(errors);
			}
			return valid;				
		}
		
		$(function() {
			$("#followUpRequestModal").modal();
			resizeModal("followUpRequestModal");
			if ($("#followUpOther").is(":checked")) {
				$("#followUpOtherContainer").show();
			}
		})
	//-->
	</script>
	
	<cfoutput>
	
		<cfform name="followUpRequestForm" id="followUpRequestForm" action="#script_name#" method="post" onsubmit="return validate();">
			<cfinput type="hidden" name="action" value="saveStudent" />
			<cfinput type="hidden" name="view" value="#returnView#" />
			<cfinput type="hidden" name="Student_ID" value="#student.getStudent_ID()#" />
			<cfif IsDefined("passback")>
				<cfloop index="keyValue" list="#passback#" delimiters=";">
					<cfinput type="hidden" name="#ListFirst(keyValue)#" value="#ListLast(keyValue)#" />
				</cfloop>
			</cfif>
			<div id="followUpRequestModal" class="modal modal-fullscreen" data-backdrop="static">
				<div class="modal-header">
					<h3>Follow Up Request</h3>
				</div>
				<div class="modal-body">
					<div class="container-fluid">
						<div class="row-fluid">
							<div class="span3">
								<div class="text-control clearfix">
									<label>Student</label>
									#student.getFirst_Name()# #student.getLast_Name()#
								</div>
								<div class="text-control clearfix">
									<label>Address</label>
									#student.getAddress()#<br />
									#student.getCity()#, CA #student.getZip_Code()#
								</div>
								<div class="text-control clearfix">
									<label>Contact Info</label>
									#student.getPhone1()#<br />
									<cfif Len(Trim(student.getPhone2())) gt 0>#student.getPhone2()#<br /></cfif>
									<a href="mailto:#student.getEmail()#">#student.getEmail()#</a>
								</div>
								<div class="text-control clearfix">
									<label>Date of Birth</label>
									#DateFormat(student.getDOB(), "m/d/yyyy")#
								</div>
								<div class="text-control clearfix">
									<label>Social Security Number</label>
									<cfif student.getSSN_Code() eq 1>
										I have an SSN
									<cfelseif student.getSSN_Code() eq 2>
										I do not have an SSN
									<cfelseif student.getSSN_Code() eq 3>
										I don't remember my SSN
									</cfif>
								</div>
							</div>
							<div class="span5">
								<div class="text-control clearfix">
									<label>Will you be the first member of your family to attend college?</label>
									<cfif evaluation.getQ5() eq 1>
										Yes
									<cfelseif evaluation.getQ5() eq 2>
										No
									<cfelse>
										<span class="muted">Did not answer</span>
									</cfif>
								</div>
								<div class="text-control clearfix">
									<label>Are you a high school senior?</label>
									<cfif evaluation.getQ7() eq 1>
										Yes
									<cfelseif evaluation.getQ7() eq 2>
										No
									<cfelseif evaluation.getQ7() eq 3>
										Family member of a senior
									<cfelse>
										<span class="muted">Did not answer</span>
									</cfif>
								</div>
								<div class="text-control clearfix">
									<label>What high school do you attend?</label>
									<cfif Len(Trim(evaluation.getQ8())) gt 0>
										#evaluation.getQ8()#
									<cfelse>
										<span class="muted">Did not answer</span>
									</cfif>
								</div>
								<div class="text-control clearfix">
									<label>What is your race/ethnicity?</label>
									<cfif ListFind(evaluation.getQ12(), 1)>
										American Indian or Alaskan Native<br />
									</cfif>
									<cfif ListFind(evaluation.getQ12(), 2)>
										Asian<br />
									</cfif>
									<cfif ListFind(evaluation.getQ12(), 3)>
										Black/African American<br />
									</cfif>
									<cfif ListFind(evaluation.getQ12(), 4)>
										Hispanic/Latino<br />	
									</cfif>
									<cfif ListFind(evaluation.getQ12(), 5)>
										Native Hawaiian or other Pacific Islander<br />	
									</cfif>
									<cfif ListFind(evaluation.getQ12(), 6)>
										White<br />	
									</cfif>
									<cfif ListFind(evaluation.getQ12(), 7)>
										Other: #evaluation.getQ12_Other()#<br />
									</cfif>
									<cfif ListFind(evaluation.getQ12(), 8)>
										Decline to Answer<br />
									</cfif>
									<cfif Len(Trim(evaluation.getQ12())) eq 0>
										<span class="muted">Did not answer</span>
									</cfif>
								</div>
								<div class="text-control clearfix">
									<label>Did you finish your FAFSA and/or CA Dream Act application today?</label>
									<cfif evaluation.getQ15() eq 1>
										Yes
									<cfelseif evaluation.getQ15() eq 2>
										Some, not all
									<cfelseif evaluation.getQ15() eq 3>
										No
									<cfelse>
										<span class="muted">Did not answer</span>
									</cfif>
								</div>
								<div class="text-control clearfix">
									<label>If you didn't finish your FAFSA and/or CA Dream Act application today, please tell us why:</label>
									<cfif ListFind(evaluation.getQ16(), 1)>
										Thought I had to have taxes completed<br />
									</cfif>
									<cfif ListFind(evaluation.getQ16(), 2)>
										Didn't bring enough financial info with me<br />
									</cfif>
									<cfif ListFind(evaluation.getQ16(), 3)>
										Technical problem with computer<br />
									</cfif>
									<cfif ListFind(evaluation.getQ16(), 4)>
										Will submit later on the Internet<br />	
									</cfif>
									<cfif ListFind(evaluation.getQ16(), 5)>
										Asked for AB 540 help<br />	
									</cfif>
									<cfif ListFind(evaluation.getQ16(), 6)>
										Other: #evaluation.getQ16_Other()#<br />
									</cfif>
									<cfif Len(Trim(evaluation.getQ16())) eq 0>
										<span class="muted">Did not answer</span>
									</cfif>
								</div>
								<div class="text-control clearfix">
									<label>Would you like more help to complete the FAFSA and/or CA Dream Act application?</label>
									<cfif evaluation.getQ17() eq 1>
										Yes
									<cfelseif evaluation.getQ17() eq 2>
										Maybe
									<cfelseif evaluation.getQ17() eq 3>
										No
									<cfelse>
										<span class="muted">Did not answer</span>
									</cfif>
								</div>
							</div>
							<div class="span4">
								<div class="clearfix">
									<label class="required">Follow Up Status</label>
									<cfselect name="Follow_Up_Status" required="yes" message="Status is required" class="span9">
										<option value="Not Complete"<cfif student.getFollow_Up_Status() eq "Not Complete" OR ((evaluation.getQ17() eq 1 OR evaluation.getQ17() eq 2) AND Len(Trim(student.getFollow_Up_Status())) eq 0)> selected</cfif>>Not Complete</option>
										<option value="Complete"<cfif student.getFollow_Up_Status() eq "Complete"> selected</cfif>>Complete</option>
									</cfselect>
								</div>
								<div class="clearfix">
									<label>Follow Up Topics</label>
									<div class="well clearfix span9" style="line-height: 24px; margin: 0; margin-bottom: 10px;">
										<label class="checkbox">
											<input type="checkbox" name="Follow_Up_FAFSA" value="1" <cfif student.getFollow_Up_FAFSA() eq 1> checked</cfif>> 
											FAFSA
										</label>
										<label class="checkbox">
											<input type="checkbox" name="Follow_Up_CA_Dream_Act" value="1" <cfif student.getFollow_Up_CA_Dream_Act() eq 1> checked</cfif>> 
											CA Dream Act
										</label>
										<label class="checkbox">
											<input type="checkbox" name="Follow_Up_Taxes" value="1" <cfif student.getFollow_Up_Taxes() eq 1> checked</cfif>> 
											Taxes
										</label>
										<label class="checkbox">
											<input type="checkbox" name="Follow_Up_Income_Assets" value="1" <cfif student.getFollow_Up_Income_Assets() eq 1> checked</cfif>> 
											Income and/or assets
										</label>
										<label class="checkbox">
											<input type="checkbox" name="Follow_Up_Cal_Grant_Deadline" value="1" <cfif student.getFollow_Up_Cal_Grant_Deadline() eq 1> checked</cfif>> 
											Cal Grants deadline
										</label>
										<label class="checkbox">
											<input type="checkbox" name="Follow_Up_Cal_Grant_Requirements" value="1" <cfif student.getFollow_Up_Cal_Grant_Requirements() eq 1> checked</cfif>> 
											Cal Grant requirements including GPA
										</label>
										<label class="checkbox">
											<input type="checkbox" id="followUpOther" onClick="toggleFollowUpOther();"<cfif Len(Trim(student.getFollow_Up_Other())) gt 0> checked</cfif>> 
											Other
										</label>
										<div id="followUpOtherContainer" style="display: none;">
											<cfinput type="text" name="Follow_Up_Other" value="#student.getFollow_Up_Other()#" placeholder="Enter other topic(s)" class="span9" />
										</div>
									</div>							
								</div>
								<div class="clearfix">
									<label>Follow Up Notes</label>
									<textarea name="Follow_Up_Notes" class="span9" rows="6">#student.getFollow_Up_Notes()#</textarea>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<a href="?view=#returnView#&#passbackQueryString#" class="btn btn-success">Cancel</a>
					<button type="submit" name="saveButton" class="btn btn-success">Save</button>
				</div>
			</div>
	
		</cfform>
	
	</cfoutput>

<cfelse>

	<div class="alert alert-info notFound">Follow up request not found or insufficient permissions to perform this operation</div>

</cfif>